package pers.cj.pdos.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import pers.cj.pdos.entity.GoodsHouseWarn;
import pers.cj.pdos.mapper.GoodsHouseWarnMapper;
import pers.cj.pdos.service.IGoodsHouseWarnService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import pers.cj.pdos.utils.Utils;
import pers.cj.pdos.vo.GoodsHouseWarnVo;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author chenj
 * @since 2019-11-04
 */
@Service
public class GoodsHouseWarnServiceImpl extends ServiceImpl<GoodsHouseWarnMapper, GoodsHouseWarn> implements IGoodsHouseWarnService {
    @Autowired
    GoodsHouseWarnMapper goodsHouseWarnMapper;

    @Override
    public Long countMinNumber(String companyId) {
        return goodsHouseWarnMapper.countMinNumber(companyId);
    }

    @Override
    public Long countMaxNumber(String companyId) {
        return goodsHouseWarnMapper.countMaxNumber(companyId);
    }

    @Override
    public List<GoodsHouseWarnVo> listVo(String companyId,
                                  Integer page,
                                  Integer limit,
                                  String storeId,
                                  String houseId,
                                  Integer type,
                                  String typeId,
                                  String search){
        return goodsHouseWarnMapper.listVo(companyId,
                Utils.genPage(page, limit),
                limit,
                storeId,
                houseId,
                type,
                typeId,
                search);
    }

    @Override
    public long count(String companyId,
               String storeId,
               String houseId,
               Integer type,
               String typeId,
               String search){
        return goodsHouseWarnMapper.count(companyId,
                storeId,
                houseId,
                type,
                typeId,
                search);
    }
}
